<?php
/**
 * Created by JetBrains PhpStorm.
 * User: CAIXUDONG
 * Date: 11-6-15
 * Time: 下午2:37
 */

switch($_SERVER['SERVER_NAME']){
    case 'pps.whoopsfeed.com':
        $site_url = 'http://'.$_SERVER['HTTP_HOST'].'/whoopsfeed-com/love/admin/';
        $db_arr = array(
            'dbtype'    =>  'mysql',
            'dbuser'    =>  'root',
            'dbpswd'    =>  'yhPNTBfbwr92JBxZ',
            'dbname'    =>  'myadmin',
            'dbhost'    =>  'localhost',
            'dbcoding'  =>  'UTF8'
        );
        break;
    case 'localhost':
    case 'home.whoopsfeed.com':
        $site_url = 'http://'.$_SERVER['HTTP_HOST'].'/whoopsfeed.com/love/admin/';
        $db_arr = array(
            'dbtype'    =>  'mysql',
            'dbuser'    =>  'root',
            'dbpswd'    =>  '',
            'dbname'    =>  'myadmin',
            'dbhost'    =>  'localhost',
            'dbcoding'  =>  'UTF8'
        );
        break;
    default :
        $site_url = 'http://'.$_SERVER['HTTP_HOST'].'/love/admin/';
        $db_arr = array(
            'dbtype'    =>  'mysql',
            'dbuser'    =>  'u253086764_love',
            'dbpswd'    =>  'F6p3DFnB2w',
            'dbname'    =>  'u253086764_dblove',
            'dbhost'    =>  'mysql.0hosting.org',
            'dbcoding'  =>  'UTF8'
        );
        break;
}

define('RUNNING_MODE',     'dev');
define('DEFAULT_DB_NAME',  'default');
define('SESS_LIFTTIME',  3600);
define('PASSWORD_PREFIX',  'pps_t_p');
//cookie域，必须设置
define('COOKIE_DOMAIN', $_SERVER['SERVER_NAME']);
//网站地址，必须设置
define('SITE_URL',  $site_url);
define('SITE_TITLE',  '爱购后台管理系统');
define('SITE_PREFIX',  'yangzi_admin_system_');
define('SESS_SAVE_PATH',  ROOT_PATH . 'session');

// 这里会修改为自定义错误处理，替换默认错误处理
// 开发模式的话，提供更好的调试信息
// 产品模式的话，所有错误、调试信息记入日志
if (RUNNING_MODE == 'dev'){
    error_reporting( E_ALL ^ E_NOTICE );
}else{
    error_reporting( 0 );
}


//不使用 GET/POST 变量方式
session_name(substr(SITE_PREFIX,0,-1));
//设置垃圾回收最大生存时间
session_cache_expire(SESS_LIFTTIME/60);
ini_set('session.gc_maxlifetime', SESS_LIFTTIME);
session_save_path(SESS_SAVE_PATH);
//使用 COOKIE 保存 SESSION ID 的方式
//session_set_cookie_params(SESS_LIFTTIME, '/', COOKIE_DOMAIN, false, true);
//ini_set('session.use_cookies', 1);
//ini_set('session.cookie_path', '/');

$defaule_album = array(
    'album_id' =>0,
    'album_name' =>'默认专辑',
    'album_content' =>'Wo de default album!!!',
    'album_status' =>1,
    'album_status_content' =>'审核通过',
    'add_time' =>'2012-11-31 23:59:59'
);


$db_configs = array(
    'default'    =>  $db_arr,

    'sqlite'     =>  array(
        'dbtype'    =>  'sqlite',
        'dbuser'    =>  '',
        'dbpswd'    =>  '',
        'dbname'    =>  DB_PATH.'admin_user_system.sqlite',
        'dbhost'    =>  '',
    ),

	'oracle'     =>  array(
        'dbtype'    =>  'oci',
        'dbuser'    =>  'oracle',
        'dbpswd'    =>  'oracle',
        'dbname'    =>  'oracle',
        'dbhost'    =>  '',
    )
);